home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
IRIX Base Documentation 1998 November
/
IRIX 6.5.2 Base Documentation November 1998.img
/
usr
/
share
/
catman
/
p_man
/
cat3
/
f90
/
ieee_copy_sign.z
/
ieee_copy_sign
Wrap
Text File
|
1998-10-30
|
3KB
|
87 lines
IEEE_COPY_SIGN(3I) Last changed: 1-6-98
NNAAMMEE
IIEEEEEE__CCOOPPYY__SSIIGGNN - Returns _x with the sign of _y
SSYYNNOOPPSSIISS
IIEEEEEE__CCOOPPYY__SSIIGGNN (([XX==]_x,, [YY==]_y))
IIMMPPLLEEMMEENNTTAATTIIOONN
UNICOS/mk and IRIX systems
CRAY T90 systems that support IEEE floating-point arithmetic
SSTTAANNDDAARRDDSS
CF90 and MIPSpro 7 Fortran 90 compiler extension to Fortran 90
IEEE Standard for Binary Floating-point Arithmetic
DDEESSCCRRIIPPTTIIOONN
The IIEEEEEE__CCOOPPYY__SSIIGGNN intrinsic function returns _x with the sign of _y.
For example,
AABBSS((_x)) == IIEEEEEE__CCOOPPYY__SSIIGGNN((_x,, 11..00)) even if _x is a NaN.
The Fortran 90 standard SSIIGGNN(3M) intrinsic function produces the same
result as IIEEEEEE__CCOOPPYY__SSIIGGNN on systems that support IEEE floating-point
arithmetic.
This function accepts the following arguments:
_x Must be of type real.
_y Must be of type real. If _x is a scalar, _y must be a scalar.
If _x is an array, _y can be scalar or an array of the same
shape as _x.
IIEEEEEE__CCOOPPYY__SSIIGGNN is an elemental function. The name of this intrinsic
cannot be passed as an argument.
NNOOTTEESS
The IEEE intrinsic procedures use the named constants contained in a
system module, so you must include one of the following statements in
your program:
* On UNICOS and UNICOS/mk systems: UUSSEE CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
* On UNICOS, UNICOS/mk, and IRIX systems: UUSSEE FFTTNN__IIEEEEEE__DDEEFFIINNIITTIIOONNSS
The CCRRII__IIEEEEEE__DDEEFFIINNIITTIIOONNSS module is obsolescent. It will be removed
for the CF90 4.0 release.
RREETTUURRNN VVAALLUUEESS
The return value is of the same type and type parameter as _x. If _x is
an array, the result is an array of the same shape as _x.
If _x is scalar, the result is a scalar that has the same value as _x
but with the sign of _y.
If _x is an array and _y is scalar, the result is an array in which each
element has the value of the corresponding element of _x and the sign
of _y.
If _x is an array and _y is an array, the result is an array in which
each element has the value of _x but the sign of _y .
_i _i
EEXXAAMMPPLLEESS
Example 1. Each element of _x now has its original value but with the
sign of each corresponding element of _y:
REAL x(10), y(10)
... ! Compute X and Y.
x = IEEE_COPY_SIGN(x, y)
Example 2. The following PRINT statement is executed on a system that
supports the IEEE standard for floating-point arithmetic:
PRINT *, 'IEEE_COPY_SIGN(5.0,-0.0)
The output of the preceding PRINT statement is -5.0.
SSEEEE AALLSSOO
SSIIGGNN(3M)
_I_n_t_r_i_n_s_i_c _P_r_o_c_e_d_u_r_e_s _R_e_f_e_r_e_n_c_e _M_a_n_u_a_l, publication SR-2138, for the
printed version of this man page.